@database cli_dtc.doc @master doc/cli_dtc.doc @node main "cli_dtc.doc" @toc xref.library_xreffile@main @{settabs 40}@{" cli.datatype " link "cli.datatype"} @endnode @node "cli.datatype" "cli.datatype/cli.datatype" @{b}NAME@{ub} cli.datatype - data type for launching extern programs and displaying the command's standard output @{b}FUNCTION@{ub} This datatype launches an extern command and displays the standard output of that command. This is useful to view the contents of a archive like lha or tar archives without writing a complete datatype. The standard output is placed in a tempory file in "T:", because the datatypes.library can't handle pipes. From V39.2 the cli.datatype uses NewDTObject() for the tempory file. So it's possible to display files, which have special datatypes (e.g. Unix-Manual-Pages). @{b}PREFS@{ub} The cli datatype is configured by a preference file "cli.prefs" in "PROGDIR:Prefs/Datatypes/" or "Env:Datatypes/". The file is parsed using @{"ReadArgs()" link "dos/ReadArgs()"} with the following template : "@{"DATATYPE" link "AG:SysInc/datatypes/datatypes.h/main" 174}/A,STACK/N/K,SUFFIX/K,COMMAND/F/K/A" @{"DATATYPE" link "AG:SysInc/datatypes/datatypes.h/main" 174} - specifies the datatype STACK - size of stack to use for the command SUFFIX - suffix to use for tempory file, thus the datatypes.library can determine the type of the file (e.g: ".0" for Man-Datatype) COMMAND - specifies the command to launch for that datatype, a "%s" in the command string is replaced by the real filename. @{b}EXAMPLE@{ub} ; cli.datatype preference file Lha COMMAND=lha v %s Tar COMMAND=tar tvf %s NRoff STACK=50000 SUFFIX=.0 COMMAND=bin:groff -man -Tascii %s @{b}METHODS@{ub} @{"OM_NEW" link "AG:SysInc/intuition/classusr.h/main" 63} - create a new object and launch the extern command @{"OM_DISPOSE" link "AG:SysInc/intuition/classusr.h/main" 64} - delete the object @{b}TAGS@{ub} none @{b}NOTE@{ub} With the used method of creating and handling of tempory output, it's also possible to create a special datatype for crunshed files through PowerPacker or XPK. All what have to be done is to create a tempory file and then call NewDTObject() on that. The source of the cli.datatype gives a the skeleton for such datatypes. Please feel free to implement XPK or PowerPacker datatypes. I don't do this. @{b}SEE ALSO@{ub} text.datatype, @{"ascii.datatype" link "ascii_dtc/ascii.datatype"}, datatypes.library @endnode